<template>
  <div id="app">
    <transition :name="getTransitionName">
      <router-view class="child-view" />
    </transition>

    <van-tabbar v-model="active" route v-if="!$store.state.isFullPage">
      <van-tabbar-item icon="home-o" to="/">Home</van-tabbar-item>
      <van-tabbar-item icon="search">标签</van-tabbar-item>
      <van-tabbar-item icon="setting-o" to="/404">Not Found</van-tabbar-item>
      <van-tabbar-item icon="friends-o" to="/about">About</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  name: "App",
  data() {
    return {
      // transitionName: "slide-left",
      active: 0,
    };
  },
  //在路由发生变化时监听是前进还是后退状态，应用不同动画
  computed: {
    ...mapGetters(["getTransitionName"]),
  },
  mounted() {
    // this.transitionName = this.$store.state.transitionName;
  },
  methods: {},
};
</script>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  // text-align: center;
  color: #2c3e50;
  width: 100%;
  height: 100vh;
  font-size: 16px;
  background: rgb(244, 245, 245);
}

#nav {
  width: 100%;
  height: 60px;
  position: fixed;
  bottom: 0;
  left: 0;
  text-align: center;
  line-height: 60px;
  overflow-x: scroll;
  display: flex;
  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
